ZHIFUBAO={};
ZHIFUBAO.init=function(){
    ZHIFUBAO.jump();
}

ZHIFUBAO.jump=function(){
	var url = url_('api/V4/get_ali_account')
	var success = function(d){
		if (d.code == 0) {
			if (d.data.payee_account != "") {
				mainView.router.load({
					'url':'src/my_center/bangding_account/tixian_zhifubao.html',
					context:d
				})
			} else{
				mainView.router.load({
					'url':'src/my_center/bangding_account/tixian_zhifubao_null.html',
					context:d
				})
			}
			
		} else{
			my_tips_(d.msg)
		}
	}
	request_(url,{},success)
}
ZHIFUBAO.bind_user = function(){
	var url = url_('api/V4/bind_ali_account');
	var real_name = $("#zfb_name").val();
	var payee_account = $("#zfb_count").val();
	var data = {
		"real_name":real_name,
		"payee_account":payee_account
	}
	var success = function(d){
		if (d.code == 0) {
			my_tips_('绑定支付宝成功',function(){
				go_href_('#/bangding_account');
			});
		} else{
			my_tips_(d.msg)
		}
	}
	request_(url,data,success)
}

//换绑
ZHIFUBAO.huan_bind_user = function(){
	mainView.router.load({
		'url':'src/my_center/bangding_account/tixian_zhifubao_null.html'
	})
}
	
//ZHIFUBAO.yanzheng_tel = function(){
// 	var phone = Storage_.get('member_info').telephone;
//	phone = phone.slice(0,3) + '****' + phone.slice(-4);
//  mainView.router.load({
//      url: 'test_phone.html',
//      context: {"action": "zfb_phone","phone": phone}
//  });
//}
